package org.example.web;

import org.example.base.BaseResp;
import org.example.utils.RedisUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author huangy
 * @description
 * @since 2023/2/8 10:32
 **/
@RestController
@RequestMapping("redis")
public class TestController {

    @Resource
    private RedisUtils redisUtils;

    /*
     * @description 多值set
     * @author huangy
     * @since 2023/2/8 14:14
     * @return org.example.base.BaseResp<?>
     **/
    @PostMapping("mSet")
    public BaseResp<?> mSet() {
        redisUtils.mSet();
        return BaseResp.success();
    }

    @GetMapping("mGet")
    public BaseResp<?> mGet() {
        return BaseResp.success(redisUtils.mGet());
    }

    @PostMapping("mDel")
    public BaseResp<?> mDel() {
        redisUtils.mDel();
        return BaseResp.success();
    }

}
